package com.ultrapower.bean;

import java.util.List;

public class SpanEventBean {
	private byte version = 0;

	private short sequence;

	private int startElapsed;
	private int endElapsed;

	private String rpc;
	private short serviceType;

	private String destinationId;
	private String endPoint;
	private int apiId;

	private List<AnnotationBean> annotationBoList;

	private int depth = -1;
	private long nextSpanId = -1;

	private boolean hasException;
	private int exceptionId;
	private String exceptionMessage;

	// should get exceptionClass from dao
	private String exceptionClass;

	private int asyncId = -1;
	private int nextAsyncId = -1;
	private short asyncSequence = -1;

	public void setExceptionInfo(int exceptionId, String exceptionMessage) {
		this.hasException = true;
		this.exceptionId = exceptionId;
		this.exceptionMessage = exceptionMessage;
	}

	public int getAsyncId() {
		return asyncId;
	}
    public short getAsyncSequence() {
        return asyncSequence;
    }

	public void setAsyncId(int asyncId) {
		this.asyncId = asyncId;
	}

	public void setAsyncSequence(short asyncSequence) {
		this.asyncSequence = asyncSequence;
	}

	
	public byte getVersion() {
		return version;
	}

	public void setVersion(byte version) {
		this.version = version;
	}

	public short getSequence() {
		return sequence;
	}

	public void setSequence(short sequence) {
		this.sequence = sequence;
	}

	public int getStartElapsed() {
		return startElapsed;
	}

	public void setStartElapsed(int startElapsed) {
		this.startElapsed = startElapsed;
	}

	public int getEndElapsed() {
		return endElapsed;
	}

	public void setEndElapsed(int endElapsed) {
		this.endElapsed = endElapsed;
	}

	public String getRpc() {
		return rpc;
	}

	public void setRpc(String rpc) {
		this.rpc = rpc;
	}

	public short getServiceType() {
		return serviceType;
	}

	public void setServiceType(short serviceType) {
		this.serviceType = serviceType;
	}

	public String getDestinationId() {
		return destinationId;
	}

	public void setDestinationId(String destinationId) {
		this.destinationId = destinationId;
	}

	public String getEndPoint() {
		return endPoint;
	}

	public void setEndPoint(String endPoint) {
		this.endPoint = endPoint;
	}

	public int getApiId() {
		return apiId;
	}

	public void setApiId(int apiId) {
		this.apiId = apiId;
	}

	public List<AnnotationBean> getAnnotationBoList() {
		return annotationBoList;
	}

	public void setAnnotationBoList(List<AnnotationBean> annotationBoList) {
		this.annotationBoList = annotationBoList;
	}

	public int getDepth() {
		return depth;
	}

	public void setDepth(int depth) {
		this.depth = depth;
	}

	public long getNextSpanId() {
		return nextSpanId;
	}

	public void setNextSpanId(long nextSpanId) {
		this.nextSpanId = nextSpanId;
	}

	public boolean isHasException() {
		return hasException;
	}

	public void setHasException(boolean hasException) {
		this.hasException = hasException;
	}

	public int getExceptionId() {
		return exceptionId;
	}

	public void setExceptionId(int exceptionId) {
		this.exceptionId = exceptionId;
	}

	public String getExceptionMessage() {
		return exceptionMessage;
	}

	public void setExceptionMessage(String exceptionMessage) {
		this.exceptionMessage = exceptionMessage;
	}

	public String getExceptionClass() {
		return exceptionClass;
	}

	public void setExceptionClass(String exceptionClass) {
		this.exceptionClass = exceptionClass;
	}

	public int getNextAsyncId() {
		return nextAsyncId;
	}

	public void setNextAsyncId(int nextAsyncId) {
		this.nextAsyncId = nextAsyncId;
	}
	public boolean hasException() {
        return hasException;
    }

	@Override
	public String toString() {
		return "SpanEventBean [version=" + version + ", sequence=" + sequence + ", startElapsed=" + startElapsed
				+ ", endElapsed=" + endElapsed + ", rpc=" + rpc + ", serviceType=" + serviceType + ", destinationId="
				+ destinationId + ", endPoint=" + endPoint + ", apiId=" + apiId + ", annotationBoList="
				+ annotationBoList + ", depth=" + depth + ", nextSpanId=" + nextSpanId + ", hasException="
				+ hasException + ", exceptionId=" + exceptionId + ", exceptionMessage=" + exceptionMessage
				+ ", exceptionClass=" + exceptionClass + ", asyncId=" + asyncId + ", nextAsyncId=" + nextAsyncId
				+ ", asyncSequence=" + asyncSequence + "]";
	}

}
